Skip to content

Update f-string errors, handle != in f-string.#1776

Closed
philippeitis wants to merge 25 commits into
RustPython:masterfrom
philippeitis:master
Closed

Update f-string errors, handle != in f-string.#1776
philippeitis wants to merge 25 commits into
RustPython:masterfrom
philippeitis:master

Conversation

@philippeitis

@philippeitis philippeitis commented Feb 26, 2020

Copy link
Copy Markdown
Contributor

This pull request addresses #1770.

It correctly handles != inside of f strings, as well as f"{!a}" not returning an EmptyExpression error.

This also adds an error for conversion flags not being followed by brace characters, which would otherwise be a token error, unlike the Python implementation.

It also changes the print out for UnopenedRbrace / UnclosedLbrace to correctly print braces instead of brackets.

I've also included tests for expected brace characters and not equals operations inside of braces, as well as the expected EmptyExpression errors for f"{!a}".

@coolreader18

Copy link
Copy Markdown
Member

It looks like something weird happened with the second to last commit 4bebc19, do you think you'd be able to try undoing and redoing the changes so that git doesn't rewrite the entire file?

@philippeitis

Copy link
Copy Markdown
Contributor Author

I seem to have done something wrong - I'll open this pull request one more time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants